<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:useBean id="user" class="entity.User" scope="session"/>
<jsp:useBean id="error" class="java.lang.String" scope="request"/>
<html>
	<head>
		<title>Recreation Manager - Registracija</title>
		<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="theme.css">
		<script type="text/javascript" src="scripts/linkfader.js"></script>
		<script type="text/javascript" src="scripts/formCheck.js"></script>
	</head>
	<c:if test="${user.userId!=null}">
		<c:redirect url="./main.jsp" />
	</c:if>
	<body>
		<center>
		<form action="./Register" name="formRegister" method="post" enctype="multipart/form-data"
			 accept-charset="ISO-8859-1"  onSubmit="return checkRegistration()">
		<table class="userRegTable">
			<tr>
				<td colspan = "2"><h1 align="center">Registracija korisnika</h1></td>
			</tr>
			<tr>
				<td colspan = "2" align="center">
				<c:choose>
					<c:when test="${not empty error}">
						<font color="red">Registracija neuspešna!<br/>Proverite unete podatke!</font>
					</c:when>
					<c:otherwise>
						&nbsp;
					</c:otherwise>
				</c:choose>				
				</td>
			</tr>
			<tr>
				<td>E-mail adresa (*):</td>
				<td><input type="text" name="email"></td>
			</tr>
			<tr>
				<td>Lozinka (*):</td>
				<td><input type="password" name="passwd1"></td>
			</tr>
			<tr>
				<td>Lozinka ponovo (*):</td>
				<td><input type="password" name="passwd2"></td>
			</tr>
			<tr>
				<td>Ime (*):</td>
				<td><input type="text" name="firstName"></td>
			</tr>
			<tr>
				<td>Prezime (*):</td>
				<td><input type="text" name="lastName"></td>
			</tr>
			<tr>
				<td>Broj telefona (*):</td>
				<td><input type="text" name="telNo"></td>
			</tr>
			<tr>
				<td>Slika:</td>
				<td><input type="file" name="avatar"></td>
			</tr>
			<tr>
				<td colspan="2">Polje označene sa (*) su obavezne!</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td><input type="submit" name="submit" value="Registracija" ></td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td><a href="login.jsp">&lt;&lt; Nazad</a></td>
				<td>&nbsp;</td>				
			</tr>
		</table>
		</form>
		</center>
	</body>	
</html>